package org.sample.junit4;

/**
 * 计算器类，作为测试的对象
 */
public class Calculator {
    public int add(int a, int b) {
        return a + b;
    }

    public int divide(int a, int b) {
        if (0 == b) {
            throw new ArithmeticException("除数不能为0");
        }

        return a / b;
    }

    public int square(int n) {
        return n * n;
    }

    public int multiply(int a, int b) {
        return a * b;
    }
}
